<template>
	<view class="settings">
		<uv-cell-group :border="false" :custom-style="{ backgroundColor: '#FFFFFF', borderRadius: '10px' }">
			<uv-cell title="隐私政策" clickable isLink size="large"></uv-cell>
			<uv-cell title="用户服务协议" clickable isLink size="large"></uv-cell>
			<uv-cell title="工人服务协议" clickable isLink size="large"></uv-cell>
			<uv-cell title="关于我们" clickable isLink size="large"></uv-cell>
		</uv-cell-group>
		<view class="logout-btn safe-bottom-padding">
			<uv-button type="primary" @click="handleLogout">退出登录</uv-button>
		</view>
	</view>
</template>

<script setup>
import { useUserStore } from "@/store/user";

const userStore = useUserStore();

const handleLogout = async () => {
	await userStore.fetchLogout();
	uni.showToast({
		title: "已退出",
		icon: "none",
		mask: true
	});
	uni.reLaunch({
		url: "/pages/mine/mine"
	});
};
</script>

<style lang="scss" scoped>
.settings {
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
</style>
